<%
layout("/layouts/platform.html"){
%>
<%DIRECTIVE DYNAMIC;%>
<form id="companyAddForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/student/toOneEditDo" method="post">
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-default navbar-btn" href="${base}/platform/student/toOne" data-pjax><i class="ti-angle-left" id="goback"></i> 返回</a>
    </div>
    <div class="pull-right">
    	<div class="btn-group tool-button">
    	 	<button class="btn btn-default navbar-btn" data-loading-text="正在提交...">提 交</button>
        </div>
   </div>
</header>

<div class="content-wrap">
	<div class="wrapper" style="min-height:500px;height: 100%;">
		<div class="box-tab">
			<ul class="nav nav-tabs">
				<li class="active">
          			<a href="#base_info" data-toggle="tab">体检录入</a>
				</li>
           	</ul>
			<div class="tab-content">
				<input type="hidden" name="id" value="${obj.student.id!}"/>
                <input type="hidden" name="customer_id" value="${obj.student.customer_id!}"/>
                <input type="hidden" name="enroll_id" value="${obj.student.enroll_id!}"/>
                
                <input type="hidden" name="progress" value="${obj.student.progress!}"/>
                <input type="hidden" name="enroll_state" value="${obj.student.enroll_state!}"/>
         		<div class="tab-pane fade active in" id="base_info">
         			<div class="row mb10">
                     	<div class="form-group">
                            <label for="name" class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-2">
                                <input type="text" id="name" value="${obj.student.name!}" class="form-control" name="name"   placeholder="名称" readonly="readonly">
                            </div>
                            
                            <label for="mobile" class="col-sm-2 control-label">电话</label>
                            <div class="col-sm-2">
                                <input type="text" id="mobile"  value="${obj.student.mobile!}" class="form-control" name="mobile"  placeholder="电话"   data-parsley-type="number" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="company_id" class="col-sm-2 control-label">档案归属</label>
	                 		<div class="col-sm-6">
                                <input type="text"  value="${obj.company.name!}" class="form-control" readonly="readonly"  placeholder="档案归属">
                                <input type="hidden"  value="${obj.company.id!}" name="company_id" >
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="enroll_time" class="col-sm-2 control-label">报名时间</label>
                            <div class="col-sm-6">
	                         	<input type="text" id="enroll_time" name="enroll_time" value="${obj.student.enroll_time!}" />
	                		</div>
                        </div>
                        <div class="form-group">
                			<label for="school_id" class="col-sm-2 control-label">分配驾校</label>
	                 		<div class="col-sm-6">
	                 			<select id="school_id" name="school_id" class="form-control" required="required">
                                	<option value="">--选择驾校--</option>
                                	<%for(school in obj.schoolList){%>
                                		 <option value="${school.id}"  <% if(obj.student.school_id ==school.id){%>selected="selected"<%}%> >${school.name}</option>
                                	<%}%>
                                </select>
                            </div>
                      	</div>  
                        
                        <div class="form-group">  
                            <label for="driving_type" class="col-sm-2 control-label">驾考类型</label>
	                 		<div class="col-sm-6">
	                 			<select id="driving_type" name="driving_type" class="form-control"  required="required">
                                	<option value="" >--选择驾考类型--</option>
                                	<option value="C1"  <% if(obj.student.driving_type =='C1'){%>selected="selected"<%}%> >C1</option>
                                	<option value="C2"  <% if(obj.student.driving_type =='C2'){%>selected="selected"<%}%> >C2</option>
                                </select>
                            </div>
                        </div>
               		</div>
         		</div>
         	</div>
   		</div>
    </div>
</div>
</form>
<script language="JavaScript">
    $(document).ready(function () {
    	$('.form_datetime').datetimepicker({
            language:  'zh-CN',
            format:'yyyy-mm-dd',
            minView: "month",
            timepicker:false,
            todayBtn:  1,
            autoclose: 1
        });
        $('#companyAddForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code==0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goback").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
            }
        });
    });
</script>
<%}%>